<template>
	<article>
		<el-dialog title="权限设置" :visible.sync="bol" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false" size="small">

			<el-tree :data="dadtaList" show-checkbox node-key="name" ref="tree" class="tree" :default-expanded-keys="[2, 3]" :default-checked-keys="[5]" :props="defaultProps">
			</el-tree>

			<span slot="footer" class="dialog-footer">
		    	<el-button @click="cancel">取 消</el-button>
		    	<el-button type="primary" @click="submit">确 定</el-button>
		  	</span>
		</el-dialog>
	</article>
</template>

<script type="text/javascript">
	export default {
		data() {
			return {
				bol: true,
				dadtaList: [{
						name: 'yf',
						label: '研发',
						children: [{
								name: 'yfjkgl',
								label: '接口管理'
							},
							{
								name: 'yfjkjk',
								label: '接口监控'
							},
							{
								name: 'yfsjkbgl',
								label: '数据库表管理'
							}
						]
					},
					{
						name: 'xz',
						label: '行政',
						children: [{
								name: 'xzrygl',
								label: '人员管理'
							},
							{
								name: 'xzjsgl',
								label: '教室管理'
							},
							{
								name: 'xzpjgl',
								label: '评价管理'
							},
							{
								name: 'xzqjgl',
								label: '请假管理'
							},
							{
								name: 'xzjjrgl',
								label: '节假日管理'
							},
							{
								name: 'xzlsjs',
								label: '老师（结算）'
							}
						]
					},
					{
						name: 'jw',
						label: '教务',
						children: [
						    {
								name: 'jwbjgl',
								label: '班级管理'
							},
							{
								name: 'jwpkgl',
								label: '排课管理'
							},
							{
								name: 'jwlskb',
								lable: '老师课表'
							},
							{
								name: 'jwqxkb',
								label: '全校课表'
							},
							{
								name: 'jwkq',
								label: '考勤'
							},
							{
								name: 'jwkscjgl',
								lable: '考试成绩管理'
							},
							{
								name: 'jwzycjgl',
								lable: '作业成绩管理'
							},
							{
								name: 'jwxxgl',
								lable: '消息管理'
							},
							{
								name: 'jwtszyjc',
								lable: '听说作业检查'
							}
						]
					},
					{
						name: 'jxcgl',
						label: '进销存管理',
						children: [{
								name: 'jxcglcksz',
								label: '仓库设置'
							},
							{
								name: 'jxcglwpsz',
								label: '物品设置'
							},
							{
								name: 'jxcglkssz',
								label: '课时设置'
							},
							{
								name: 'jxcglkccx',
								label: '库存查询'
							},
							{
								name: 'jxcglcgrk',
								label: '采购入库'
							},
							{
								name: 'jxcglcgth',
								label: '采购退货'
							},
							{
								name: 'jxcglbs',
								label: '报损'
							},
							{
								name: 'jxcgllsly',
								label: '老师领用'
							},
							{
								name: 'jxcgllstl',
								label: '老师退领'
							},
							{
								name: 'jxcglxsxs',
								label: '学生销售'
							}
						]
					}

				],
				defaultProps: {
					children: 'children',
					label: 'label'
				}
			}
		},
		methods: {
			cancel() {
				this.$emit('close', {
					type: 'authority',
					cancel: true
				})
			},
			submit() {
				this.$emit('close', {
					type: 'authority',
					cancel: true
				})
			}
		}
	}
</script>